package zzs.generalframework.coder.core.encoder.temp.console.executor;

import java.text.Annotation;

import zzs.generalframework.coder.common.model.ClazzBO;
import zzs.generalframework.common.common.annotation.EntityBO;
import zzs.generalframework.common.core.authorization.authfunction.AuthFunctionBO;
import zzs.generalframework.common.core.authorization.authrole.AuthRoleBO;
import zzs.generalframework.common.core.authorization.authrolefunctionmap.AuthRoleFunctionMapBO;
import zzs.generalframework.common.core.authorization.authuserrolemap.AuthUserRoleMapBO;
import zzs.generalframework.common.core.parameter.commonparameter.address.AddressBO;
import zzs.generalframework.common.core.parameter.commonparameter.censusregistertype.CensusRegisterTypeBO;
import zzs.generalframework.common.core.parameter.commonparameter.department.DepartmentBO;
import zzs.generalframework.common.core.parameter.commonparameter.dictionary.DictionaryBO;
import zzs.generalframework.common.core.parameter.commonparameter.dimissiontype.DimissionTypeBO;
import zzs.generalframework.common.core.parameter.commonparameter.jobtitle.JobTitleBO;
import zzs.generalframework.common.core.parameter.commonparameter.maritalstatus.MaritalStatusBO;
import zzs.generalframework.common.core.parameter.commonparameter.nationality.NationalityBO;
import zzs.generalframework.common.core.parameter.commonparameter.operatingpost.OperatingPostBO;
import zzs.generalframework.common.core.parameter.commonparameter.politicalstatus.PoliticalStatusBO;
import zzs.generalframework.common.core.parameter.commonparameter.recordstatus.RecordStatusBO;
import zzs.generalframework.common.core.parameter.technicalparameter.menu.MenuBO;
import zzs.generalframework.common.core.parameter.technicalparameter.sysconfig.SysConfigBO;
import zzs.generalframework.common.core.user.userattence.UserAttenceBO;
import zzs.generalframework.common.core.user.userbaseinner.UserBaseInnerBO;
import zzs.generalframework.common.core.user.userbaseweb.UserBaseWebBO;
import zzs.generalframework.common.core.user.usercontact.UserContactBO;
import zzs.generalframework.common.core.user.userdetailinner.UserDetailInnerBO;
import zzs.generalframework.common.core.user.usereducation.UserEducationBO;
import zzs.generalframework.common.core.user.userloginweb.UserLoginWebBO;
import zzs.generalframework.common.core.user.usersalary.UserSalaryBO;
import zzs.generalframework.common.core.user.usersecurityweb.UserSecurityWebBO;

/**
 * @title
 * @description
 * @project zzs-coder
 * @package zzs.generalframework.coder.core.encoder.temp.console.executor
 * @author zzs
 * @date 2018年2月1日
 * @version 1.0
 */
public class ClazzBOFactory
{

	public ClazzBO getClassBO()
	{
		ClazzBO clazzBO = null;
		try
		{
			/*
			clazzBO = getBO(AuthFunctionBO.class);
			clazzBO = getBO(AuthRoleBO.class);
			clazzBO = getBO(AuthRoleFunctionMapBO.class);
			clazzBO = getBO(AuthUserRoleMapBO.class);
			clazzBO = getBO(AddressBO.class);
			clazzBO = getBO(CensusRegisterTypeBO.class);
			clazzBO = getBO(DepartmentBO.class);
			clazzBO = getBO(DictionaryBO.class);
			clazzBO = getBO(DimissionTypeBO.class);
			clazzBO = getBO(JobTitleBO.class);
			clazzBO = getBO(MaritalStatusBO.class);
			clazzBO = getBO(NationalityBO.class);
			clazzBO = getBO(OperatingPostBO.class);
			clazzBO = getBO(PoliticalStatusBO.class);
			clazzBO = getBO(RecordStatusBO.class);
			clazzBO = getBO(MenuBO.class);
			clazzBO = getBO(SysConfigBO.class);
			clazzBO = getBO(UserAttenceBO.class);
			clazzBO = getBO(UserBaseInnerBO.class);
			clazzBO = getBO(UserBaseWebBO.class);
			clazzBO = getBO(UserContactBO.class);
			clazzBO = getBO(UserDetailInnerBO.class);
			clazzBO = getBO(UserEducationBO.class);
			clazzBO = getBO(UserLoginWebBO.class);
			clazzBO = getBO(UserSalaryBO.class);
			 */
			clazzBO = getBO(UserSecurityWebBO.class);
			/*
*/
		}
		catch (ClassNotFoundException e)
		{
			e.printStackTrace();
		}
		return clazzBO;
	}

	private ClazzBO getBO(Class clazz) throws ClassNotFoundException
	{
		ClazzBO clazzBO = new ClazzBO();

		// EntityBO entityBO = (EntityBO) clazz.getAnnotation(EntityBO.class);

		EntityBO entityBO = (EntityBO) clazz.getDeclaredAnnotation(EntityBO.class);

		if (entityBO != null)
		{
			clazzBO.setClassName(entityBO.entityName());
			clazzBO.setEntityName(entityBO.classDesc());
			clazzBO.setEntityCode(entityBO.entityName());
			clazzBO.setEntityCodeCamal(entityBO.camelEntityName());
		}

		return clazzBO;
	}

}
